//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_2843 {
    public demo_2843() {
    }

    public int countSymmetricIntegers(int low, int high) {
        int count = 0;

        for(int i = low; i <= high; ++i) {
            String str = Integer.toString(i);
            int n = str.length();
            if (n % 2 == 0) {
                int num = 0;

                for(int j = 0; j < n / 2; ++j) {
                    num += str.charAt(j);
                }

                for(int j = n / 2; j < n; ++j) {
                    num -= str.charAt(j);
                }

                if (num == 0) {
                    ++count;
                }
            }
        }

        return count;
    }
}
